# This sample code uses the Appium python client
# pip install Appium-Python-Client
# Then you can paste this into a file and simply run with Python
import time
from appium import webdriver
from appium.webdriver.common.mobileby import MobileBy
caps = {} # 字典，收集所有配置信息
caps["deviceName"] = "x1q" # 设备名称
caps["platformName"] = "Android" # 平台系统
caps["platformVersion"] = "7.1.2" # 系统版本
caps["appPackage"] = "com.lingyue.zebraloan" # 包名
caps["appActivity"] = "com.lingyue.banana.activities.BananaLaunchActivity" # activity事件
driver = webdriver.Remote("http://localhost:4723/wd/hub", caps) # 初始化驱动
driver.implicitly_wait(15) # 隐式等待
driver.find_element(MobileBy.ID,"com.lingyue.zebraloan:id/tv_confirm").click() # 查找元素，点击
time.sleep(15)
driver.quit() # 退出